import { BaseFormType } from '../../views/system/data/menu'
import request from '../../utils/request.ts'
// 添加菜单
export const apiAddMenu = async (data: BaseFormType) => {
    return request({
        url: '/system/menu/add',
        method: 'post',
        data: data
    });
}

// 获取所有目录菜单
export const apiMenuAll = async () => {
    return request({
        url: '/system/menu/list',
        method: 'get',
    });
}

// 获取菜单详情
export const apiMenuDetail = async (menuId: number) => {
    return request({
        url: `/system/menu/detail?menuId=${ menuId }`,
        method: 'get',
    });
}

// 更新菜单信息
export const apiUpdateMenu = async (data: BaseFormType) => {
    return request({
        url: `/system/menu/update`,
        method: 'post',
        data
    });
}

// 删除菜单
export const apiDeleteMenu = async (ids: any[]) => {
    return request({
        url: `/system/menu/delete`,
        method: 'post',
        data: ids
    });
}
